package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.PubType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/10/14.
 */
@Entity
@Table(name = "publication")
@DynamicInsert
@DynamicUpdate
public class Publication extends IDEntityMall {
    @Column(columnDefinition = "varchar(255) comment'介绍'")
    private String intro;
    @Column(columnDefinition = "varchar(255) comment'主图片路径'")
    private String logoPath;
    @Column(columnDefinition = "bigint(20) comment'平台ID'")
    private Long mallId;
    @Column(columnDefinition = "int(20) comment'序号（排序字段）'")
    private Integer seqNo;
    @Column(columnDefinition = "varchar(255) comment'标题'")
    private String title;
    @Column(columnDefinition = "varchar(255) comment'类型'")
    @Enumerated(EnumType.STRING)
    private PubType type;

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getLogoPath() {
        return logoPath;
    }

    public void setLogoPath(String logoPath) {
        this.logoPath = logoPath;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Integer getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(Integer seqNo) {
        this.seqNo = seqNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public PubType getType() {
        return type;
    }

    public void setType(PubType type) {
        this.type = type;
    }


    @Override
    public String toString() {
        return "Publication{" +
                "intro='" + intro + '\'' +
                ", logoPath='" + logoPath + '\'' +
                ", id=" + id +
                ", mallId=" + mallId +
                ", dateCreated=" + dateCreated +
                ", seqNo=" + seqNo +
                ", title='" + title + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", type=" + type +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}
